package com.ct.gd.passport.view.policy;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ct.gd.passport.R;
import com.ct.gd.passport.domain.PolicyCatalog;
import com.up91.common.android.view.adapter.SimpleListAdapter;

public class PolicyCatalogListAdapter extends SimpleListAdapter<PolicyCatalog> {

	private class ViewHolder {
		TextView	tvName;
	}

	public PolicyCatalogListAdapter(Context context, List<PolicyCatalog> data) {
		super(context, data);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (null == convertView) {
			convertView = mInflater.inflate(R.layout.root_catalog_list_item, null);
			holder = new ViewHolder();
			holder.tvName = (TextView) convertView.findViewById(R.id.tv_root_catalog_name);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.tvName.setText(getData().get(position).getName());
		return convertView;
	}
}